<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.dongtian{
				border: 15px groove gold;
				text-align: center;
				box-shadow: 0 10px 10px 5px blue;
				margin-top: 40px;
			}
			.init{
				border: none;
				box-shadow: none;
				font-size: 14px;
				font-weight: normal;
			}
		</style>
		<script type="text/javascript">
			function changeStyle()
			{
				var d=document.getElementById("msg");
				d.style.border="5px groove red";
				d.style.fontSize="45px";
				d.style.fontWeight="900";
				d.style.textAlign="center";
				d.style.boxShadow="0 10px 10px 5px blue";
			}
			function changeStyle2()
			{
				var d2=document.getElementById("spring");
				d2.className="dongtian";
			}
			//为什么不起作用？
			function resetStyle()
			{
				//alert(555);
				console.log("dd");
				
				var d=document.getElementById("msg");
				console.log(d);
				d.className="init";
			}
		</script>
	</head>
	<body>
		<div id="msg" onmouseover="changeStyle()" onmouseout="resetStyle()">
			We change lives
		</div>
		<div id="spring">
			<img src="../img/spring.jpg" />
		</div>
		<input type="button" value="改变样式" onclick="changeStyle()" />
		
		<input type="button" value="改变样式2" onclick="changeStyle2()" />
	</body>
</html>
